/**
 * \file AlgFloyd.h
 * \brief Header file for the \a AlgFloyd class.
 * \ingroup Map
 */

#ifndef ALGFLOYD_H
#define ALGFLOYD_H

#define INFINITY	999
///<A large number. While certainly not infinite, it's much higher than a \a Unit 's maximum speed.

class Field;

#include"Map.h"

/**
 * \class AlgFloyd
 * \brief A class that will perform Floyd/Warshall's algorithm on our \a Map as a graph. 
 * 
 * A class that will perform Floyd/Warshall's algorithm on our \a Map as a graph. It should not be deleted before the \a Map is deleted and contains distance information.
 * \ingroup Map
 */

class AlgFloyd{
public:
	AlgFloyd(const Map *map);///<Constructor. \param map The \a Map on which the algorithm should be performed.
	~AlgFloyd();///<Destructor.
	void run();///<Actually performs the algorithm.
	int cost(int i, int j, int k, int l)const;///<Returns the cost of travelling from (i,j) to (k,l) \param i 1st coordinate of begin \param j 2nd coordinate of begin \param k 1st coordinate of destination \param l 2nd coordinate of destination.
private:
	const Map *m_map;///<The \a Map this algorithm is performed on.
	int m_graph[NUM_ROWS][NUM_COLS][NUM_ROWS][NUM_COLS];///<A structure for internal usage. Stores distance information.
};

#endif
